﻿using MiniExcelLibs;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ST.Torch.WebApi.Core.Utils
{
    public class MiniExcelUtil
    {
        public static List<dynamic> GetDataList(string path)
        {
            
            List<dynamic> datas = null;
            using (var stream = File.OpenRead(path))
            {
                datas = stream.Query(useHeaderRow: true).ToList();

            }
            return datas;
        }
        public static List<dynamic> GetDataList(FileStream stream)
        {
            List<dynamic> datas = null;
            using ( stream)
            {
                datas = stream.Query(useHeaderRow: true).ToList();
            }
            return datas;
        }

    }
}
